package com.mrlong.flutterstudy;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import com.shuyu.gsyvideoplayer.video.NormalGSYVideoPlayer;

import io.flutter.app.FlutterActivity;
public class PlayActivity extends FlutterActivity {

    private NormalGSYVideoPlayer sampleVideo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_play);
        String source1 = "http://9890.vod.myqcloud.com/9890_4e292f9a3dd011e6b4078980237cc3d3.f20.mp4";
        String source2 = "rtmp://202.69.69.180:443/webcast/bshdlive-pc";
        String name = "普通";
        sampleVideo = findViewById(R.id.player);
        sampleVideo.setUp(source2,false,name);
        sampleVideo.startPlayLogic();
        findViewById(R.id.btn)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        PlayActivity.this.finish();
                    }
                });
    }

    @Override
    protected void onPause() {
        super.onPause();
        sampleVideo.onVideoPause();
    }

    @Override
    protected void onResume() {
        super.onResume();
        sampleVideo.onVideoResume();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
